package com.data.modules.system.service;

import com.alibaba.fastjson.JSONObject;
import com.data.modules.system.model.CommitApprovalApplyParam;
import com.data.modules.system.model.CommitDingTalkApplyParam;
import com.data.modules.system.model.WeixinConfigDTO;

import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.net.MalformedURLException;
import java.util.Map;

/**
 * 类的描述
 *
 * @author: cg
 * @since: 2022-02-10 14:19
 **/
public interface IOaService {

    public WeixinConfigDTO getTweixinConfig(String url);

    String verifyURL(String msg_signature, String timestamp, String nonce, String echostr);

    void doCallBack(HttpServletRequest request, String msg_signature, String timestamp, String nonce);

    void startOAWorkflow() throws Exception;

    String wechatEnterpriseApplyevent(CommitApprovalApplyParam param) throws Exception;

    String mediaUpload(String type, String fileUrl) throws MalformedURLException;

    String flyBookEnterpriseApplyevent(JSONObject param) throws Exception;

    String flyBookUpload(String type, String fileUrl) throws MalformedURLException;
    /**
     * 发起钉钉审批流
     * @return
     * @throws Exception
     */
    String dingTalkEnterpriseApplyevent(CommitDingTalkApplyParam param) throws Exception;


    /**
     * 钉钉 上传附件到钉盘 获取space_id
     */
    Integer dingTalkUpload();

    /**
     * 钉钉  单步文件上传   返回 media_id对应fileId    fileName  fileSize  fileType
     */
    Map<String,String> dingTalkMediaUpload(String fileUrl) throws IOException;

    /**
     * 保存文件到自定义或审批钉盘空间
     * @param mediaId
     * @param spaceId
     * @param name 文件名称
     * @return
     */
    String addFileToDingTalk(String mediaId,String spaceId,String name);

    /**
     * 钉钉消息回调
     * @param signature
     * @param timeStamp
     * @param nonce
     * @param json
     */
    Map<String, String> doDingCallBack(String signature, String timeStamp, String nonce ,JSONObject json);





    /**
     * 获取钉钉审批实例详情
     * @param processInstanceId 审批实例ID
     * @return
     */
    JSONObject getOaMsg(String processInstanceId);


}

